using UnityEngine;
using UnityEngine.UI;

public class Pause : MonoBehaviour
{
    // Start is called once before the first execution of Update after the MonoBehaviour is created
    public Sprite pause,unpause;
    Image image;
    bool isPause;
    void Start()
    {
        image=GetComponent<Image>();
    }
    public void ChangePause()
    {
        isPause=!isPause;
        if(isPause)
        {
            LevelManager.I.PauseLevel();
        }
        else
        {
            LevelManager.I.ContinueLevel();
        }
    }
    // Update is called once per frame
    void Update()
    {
        if(isPause)
        {
            image.sprite=pause;
        }
        else
        {
            image.sprite=unpause;
        }
    }
}
